home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / demos / 20 / tvxsrc / mwc_res.s < prev    next >
Encoding:
Text File  |  1987-07-19  |  3.0 KB  |  130 lines

  1. /    module name st_res
  2. /    resolution setting stuff for Mark Williams as
  3. /
  4.     .shri
  5.  
  6.     .globl getres_
  7. getres_:
  8.     link    a6, $0
  9. /
  10. /    RESOLUTION HANDLING ROUTINES
  11. /
  12. LINEA_I        =    0xA000 
  13. GET_REZ        =    4        / extended bios resolution inquiry
  14. /
  15. /    Get current resolution of screen: 0 => color
  16. /        25, 40, or 50 lines
  17. /
  18. /getres:
  19.     move    $GET_REZ,-(sp)        / get screen resolution
  20.     trap    $14 
  21.     addq    $2,sp
  22.  
  23.     cmpi    $2,d0            / only execute if already in hi rez
  24.     bne    exgetrf 
  25.  
  26.     move    $0,d0            / clear r0
  27.  
  28.     .word    LINEA_I            / get the important pointers 
  29.  
  30.     move    -0x2A(a0),d0        / move word size to r0
  31.     addi    $1,d0            / bump to number
  32.     bra    exgetr            / and exit
  33.  
  34. exgetrf:
  35.     move    $0,d0            / fasle - color monitor
  36. exgetr:
  37.     unlk    a6
  38.     rts
  39.     .globl rez25_
  40. rez25_:
  41.     link    a6, $0
  42.     move    $GET_REZ,-(sp)        / get screen resolution
  43.     trap    $14 
  44.     addq    $2,sp
  45.  
  46.     cmpi    $2,d0            / only execute if already in hi rez
  47.     bne    ex25f 
  48.  
  49.     .word    LINEA_I            / get the important pointers 
  50.  
  51.     movea.l    8(a1),a1        / a1 -> 8x16 font header (long implied)
  52.     move.l    72(a1),-0x0A(a0)        / v_off_ad <- 8x16 offset table ad
  53.     move.l    76(a1),-0x16(a0)        / v_fnt_ad <- 8x16 font data addr 
  54.  
  55.     move    $16,-0x2E(a0)        / v_cel_ht <- 16  8x16 cell heigh
  56.     move    $24,-0x2A(a0)        / v_cel_my <- 24  maximum cell "Y" 
  57.     move    $1280,-0x28(a0)        / v_cel_wr <- 1280  vertical byte offset
  58.  
  59.     move    $1,d0            / true return
  60.     bra    ex25
  61. ex25f:
  62.     move    $0,d0            / false return
  63. ex25:    
  64.     unlk    a6
  65.     rts
  66.     .globl rez40_
  67. rez40_:
  68.     link    a6, $0
  69. /
  70. /  Make hi rez screen bios handle 40 lines of 8x8 characters
  71. /
  72.  
  73.     move    $GET_REZ,-(sp)        / get screen resolution
  74.     trap    $14 
  75.     addq    $2,sp
  76.  
  77.     cmpi    $2,d0            / only execute if already in hi rez
  78.     bne    ex40f 
  79.  
  80.     .word    LINEA_I            / get the important pointers 
  81.  
  82.     movea.l    4(a1),a1        / a1 -> 8x8 font header 
  83.     move.l    72(a1),-0x0A(a0)        / v_off_ad <- 8x8 offset table ad
  84.     move.l    76(a1),-0x16(a0)        / v_fnt_ad <- 8x8 font data addr 
  85.  
  86.     move    $8,-0x2E(a0)        / v_cel_ht <- 8    8x8 cell height
  87.     move    $39,-0x2A(a0)      / v_cel_my <- 49    maximum cell "Y" 
  88. /    use 8x8 font in 8x10 cell, giving 10*80 for v byte offset
  89.     move    $800,-0x28(a0)        / v_cel_wr <- 10*80 vertical byte offset
  90.  
  91.     move    $1,d0            / true return
  92.     bra    ex40
  93. ex40f:
  94.     move    $0,d0            / false return
  95. ex40:    
  96.     unlk    a6
  97.     rts
  98.     .globl rez50_
  99. rez50_:
  100.     link    a6, $0
  101.  
  102. /
  103. /  Make hi rez screen bios handle 50 lines of 8x8 characters
  104. /
  105.     move    $GET_REZ,-(sp)        / get screen resolution
  106.     trap    $14 
  107.     addq    $2,sp
  108.  
  109.     cmpi    $2,d0            / only execute if already in hi rez
  110.     bne    ex50f 
  111.  
  112.     .word    LINEA_I            / get the important pointers 
  113.  
  114.     movea.l    4(a1),a1        / a1 -> 8x8 font header 
  115.     move.l    72(a1),-0x0A(a0)        / v_off_ad <- 8x8 offset table ad
  116.     move.l    76(a1),-0x16(a0)        / v_fnt_ad <- 8x8 font data addr 
  117.  
  118.     move    $8,-0x2E(a0)        / v_cel_ht <- 8  8x8 cell heigh
  119.     move    $49,-0x2A(a0)        / v_cel_my <- 49  maximum cell "Y" 
  120.     move    $640,-0x28(a0)        / v_cel_wr <- 640  vertical byte offset
  121.  
  122.     move    $1,d0            / true return
  123.     bra    ex50
  124. ex50f:
  125.     move    $0,d0            / false return
  126. ex50:    
  127.     unlk    a6
  128.     rts
  129. /----------------------------------
  130.